package com.example.projecttest.fragment;

import android.content.Context;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.example.projecttest.R;

public class ExampleFragment extends Fragment {

    @Override
    public void onAttach(Context context) {
        super.onAttach(context);
        Log.i("nodeLog", "onAttach");
    }

    @Override
    public void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        Log.i("nodeLog", "onCreate");
    }

    @Nullable
    @Override
    public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        Log.d("nodeLog", "onCreateView");
        View view=inflater.inflate(R.layout.example_fragment,container,false);
        return view;
    }

    @Override
    public void onActivityCreated(@Nullable Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);
        Log.d("nodeLog", "onActivityCreated");
    }

    @Override
    public void onStart() {
        super.onStart();
        Log.d("nodeLog", "onStart");
    }

    //运行状态
    @Override
    public void onResume() {
        super.onResume();
        Log.d("nodeLog", "onResume");
    }

    @Override
    public void onPause() {
        super.onPause();
        Log.d("nodeLog", "onPause");
    }

    //处于不可见状态
    @Override
    public void onStop() {
        super.onStop();
        Log.d("nodeLog", "onStop");
    }

    //销毁视图
    @Override
    public void onDestroyView() {
        super.onDestroyView();
    }

    //ACTIVITY销毁
    @Override
    public void onDestroy() {
        super.onDestroy();
        Log.d("nodeLog", "onDestroy");
    }

    //解除关系
    @Override
    public void onDetach() {
        super.onDetach();
        Log.d("nodeLog", "onDetach");
    }
}
